<%@ page contentType="text/html;charset=gb2312"%> 
<%@ page import="java.io.*, git.bankview.sl.servlet.*" %>
<jsp:useBean id="oLogon" class="git.bankview.wl.bean.LogonBean" scope="session" />
<%
	// the user who will replace old report object must have enough rights to new a report trans(90010)
	git.bankview.wl.auth.UserAuth.validate(oLogon, "90010", git.bankview.sl.report.ReportCommon.METHOD_MODIFY);
	MultipartPostRequestAdapter mpRequest = new MultipartPostRequestAdapter(request);
	
	String transid = mpRequest.getParameter("transid");
	git.bankview.wl.auth.UserAuth.validate(oLogon, transid, git.bankview.sl.report.ReportCommon.METHOD_MODIFY);
	
	File oUploadFile = mpRequest.getUploadFile("jasperFile");
	String oUploadFileName = new File(mpRequest.getParameter("jasperFile")).getName();
	long nFileLen = oUploadFile.length();
	if (0 < nFileLen)
	{
		session.setAttribute("jasperFile", oUploadFile);
		session.setAttribute("jasperUploadFileName", oUploadFileName);
	}
	
	File[] vAccessories = mpRequest.getUploadFiles("accessories");
	if (null != vAccessories)
	{
		String[] vAccessoryFileName = mpRequest.getParameterValues("accessories");
		for (int i = 0; i < vAccessoryFileName.length; ++i)
		{
			vAccessoryFileName[i] = new File(vAccessoryFileName[i]).getName();
		}
		
		session.setAttribute("accessories", vAccessories);
		session.setAttribute("accessoryFileNames", vAccessoryFileName);
	}
	
	String forward = "/report/UpdateReportTransStart.do?transid=" + transid;
%>
<jsp:forward page="<%=forward%>" />
